37 set_title(
"method dialog");
40 m_main_box = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 10);
60 Gdk::RGBA initial_color;
61 initial_color.set_rgba(0.0, 0.0, 0.0, 1.0);
66 auto color_dialog = Gtk::ColorDialog::create();
67 color_dialog->set_title(
"Select a Custom Color");
68 color_dialog->set_modal(
true);
71 auto m_color_button = Gtk::make_managed<Gtk::ColorDialogButton>(color_dialog);
72 m_color_button->set_halign(Gtk::Align::END);
75 m_color_button->set_rgba(initial_color);
79 return m_color_button;
87 auto layout_grid = Gtk::make_managed<Gtk::Grid>();
88 layout_grid->set_column_spacing(15);
89 layout_grid->set_hexpand(
true);
90 layout_grid->set_halign(Gtk::Align::FILL);
93 auto label = Gtk::make_managed<Gtk::Label>(txt);
94 label->set_halign(Gtk::Align::START);
95 label->set_hexpand(
true);
96 label->set_halign(Gtk::Align::FILL);
97 label->set_xalign(0.0);
100 widget->set_hexpand(
true);
101 widget->set_halign(Gtk::Align::FILL);
103 layout_grid->attach(*label, 0, 0, 3, 1);
104 layout_grid->attach(*widget, 3, 0, 7, 1);
112 auto entry = Gtk::make_managed<Gtk::Entry>();
113 entry->set_text(
value);
115 fArgs.push_back(entry);
124 auto hbox = Gtk::make_managed<Gtk::Box>();
125 hbox->set_hexpand(
true);
126 hbox->set_halign(Gtk::Align::END);
129 auto button1 = Gtk::make_managed<Gtk::Button>(
"Ok");
131 auto button2 = Gtk::make_managed<Gtk::Button>(
"Cancel");
132 button2->signal_clicked().connect([
this]() { close(); });
134 hbox->append(*button1);
135 hbox->append(*button2);
145 if (!menu || !
object || !func)
154 while (
auto argument = (
TMethodArg *) next()) {
163 if (
type.CompareTo(
"enum") != 0)
164 std::cout <<
"*** Warning in Dialog(): data type is not basic type, assuming (int)\n";
174 if (
m &&
m->GetterMethod()) {
176 m->GetterMethod()->Init(
object->IsA(),
m->GetterMethod()->GetMethodName(),
"");
182 if (basictype ==
"char*") {
183 char *tdefval =
nullptr;
184 m->GetterMethod()->
Execute(
object,
"", &tdefval);
185 if (tdefval) val = tdefval;
187 if ((basictype ==
"float") ||
188 (basictype ==
"double")) {
190 m->GetterMethod()->
Execute(
object,
"", ddefval);
193 if ((basictype ==
"char") ||
194 (basictype ==
"int") ||
195 (basictype ==
"bool") ||
196 (basictype ==
"long") ||
197 (basictype ==
"short")) {
199 m->GetterMethod()->
Execute(
object,
"", ldefval);
205 ::Warning(
"Gtk4MethodDialog::Dialog",
"option menu not yet implemented");
210 if (argument->GetDefault())
211 argDflt = argument->GetDefault();
213 if ((argDflt.
Length() > 1) &&
214 (argDflt[0]==
'\"') && (argDflt[argDflt.
Length()-1]==
'\"')) {
242 for (
auto entry :
fArgs) {
243 Glib::ustring
v = entry->get_text();
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
void clearAllElements()
clear all elements inside dialog main box
void addArg(const char *argname, const char *value, const char *type)
Add method argument.
Gtk::ColorDialogButton * addColorInput(const char *title, int colindx)
add line with color button
Gtk4MethodDialog(unsigned width=400, unsigned height=200)
Create method dialog.
void methodDialog(TContextMenu *menu, TObject *object, TFunction *func)
Show method dialog.
void addLine(const char *txt, Gtk::Widget *widget)
Add single dialog line.
std::vector< Gtk::Entry * > fArgs
void on_ok_button_clicked()
Gtk::Button * addOkCancelButtons()
Add Ok and Cancel buttons.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
All ROOT classes may have RTTI (run time type identification) support added.
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
Global functions class (global functions are obtained from CINT).
TList * GetListOfMethodArgs()
Return list containing the TMethodArgs of a TFunction.
Each ROOT method (see TMethod) has a linked list of its arguments.
void AddLast(TObject *obj) override
Add object in the next empty slot in the array.
Collectable string class.
Mother of all ROOT objects.
virtual void Execute(const char *method, const char *params, Int_t *error=nullptr)
Execute method on this object with the given parameter string, e.g.
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const