Eto for Python

ShowModal
Not showModalAsync,

I was testing something else and it left it there it seems…

1 Like

ok!!! YESSSS

why does:
self.m_label = forms.Label(Text = 'Enter the Room Number:', VerticalAlignment = VerticalAlignment.Center)
doesn’t run?

That line of code isn’t in your original file so you will need to post your updated code or else that line makes no sense out of context.

excuse… i found:

        self.label_client = forms.Label(Text = 'Client:')
        self.label_client.TextAlignment=forms.TextAlignment.Right

I’m guessing you are trying to align it with the centre of the textbox.

I am not sure if that will work inside the dynamic layout mode.
You might have to put the label inside a panel to centre it.

thank you, but i just want to understand how i can use the eto documentation…
what is a propertie or methods…

I search, and sometimes I find…

thank you for your time!

Like a python, C# also has classes. These classes will contain property and methods.
The methods in python are the same as in C#, while the properties in C# are the equivalent to Pythons class variables.

There are plenty of online tutorials for python. Until you understand what a class is, the documentation might be hard to traverse.

Un property c’est comme un variable attaché à un objet. À property is like a variable attached to an object.

Un method c’est une fonction attachée à un objet, et qui va généralement interagir avec l’objet. A method is a function attached to an object, which usually interacts with the object in some way.

yes i understood that…

yes i saw a lot of, but all examples are about a human class, with name, or age… or a city class, with library or bakery.

it’s difficult for me ( for the moment, i hope) to see a form or my project, like an Object, in my script, where is the object? i understood that my object is ‘dialog’ in:

dialog = Projforms(dict_input)

it’s not clear for me for the moment, but every day i understand one more thing, so it’s ok for me…

Yes your dialog object is an instance of the Projforms class, in other words it is an objet of type Projforms. Projforms inherits from the Eto Dialog class, so your object inherits all the properties and methods you have defined in Projforms as well as those in Dialog. You should rename dialog to better distinguish it from Dialog and to describe it more explicitly, as that is a source of confusion.

-g

Hello, I know this is an old topic but I didn’t want to open a new thread for the question that I am about to ask.

I have written an eto form to show me what material weighs how many grams for the selected objects and displays this on an eto form. All is well until here. The small thing that bothers me comes up when the numbers don’t have tha same number of digits. In this case the decimal points (".") don’t align across the list.

Do you know a way to fix this? I tried .rjust() string function but it doesn’t do it. In other words I want to be able to left or right justify the texts in a column. Does AddRow() function of eto have such a property?

Hello,
I still haven’t tried eto but if you give it a string of this type would that work? '{0:7.1f}'.format (2.3)

Nope… Still the decimals are not aligned… The digits after the decimal is set to be 2 digits always but since the number of those before the decimal may vary it affects the alignment of the texts, I think. Here is how it looks…

resim

Thanks for the answer though…

It seems like only if I could add a space before the ones that have one digit before the decimal, that would solve it.